<template>
  <section>
    <el-table
      :data="tableData"
      border>
      <el-table-column
        prop="dagName"
        label="Dag Name">
        <template scope="scope">
          <el-button type="text" size="small" @click="toPage318(scope)">{{scope.row.dagName}}
          </el-button>
        </template>
      </el-table-column>
      <el-table-column
        prop="entity"
        label="Id">
      </el-table-column>
      <el-table-column
        prop="submitter"
        label="Submitter">
      </el-table-column>
      <el-table-column
        prop="status"
        label="Status">
      </el-table-column>
      <!--<el-table-column
        prop="Progress"
        label="Progress">
      </el-table-column>-->
      <el-table-column
        prop="startTime"
        label="Start Time">
        <template scope="scope">
          {{scope.row.startTime | getLocalTime}}
        </template>
      </el-table-column>
      <el-table-column
        prop="endTime"
        label="End Time">
        <template scope="scope">
          {{scope.row.endTime | getLocalTime}}
        </template>
      </el-table-column>
      <el-table-column
        prop="Duration"
        label="Duration">
        <template scope="scope">
          {{scope.row.startTime | getTimex(scope.row.endTime)}}
        </template>
      </el-table-column>
      <el-table-column
        prop="applicationId"
        label="Application Id">
        <template scope="scope">
          <router-link  :to="{path:`/page331/${scope.row.applicationId}` , query:{task_run_component_type:query.task_run_component_type} }">
            {{scope.row.applicationId}}
          </router-link>
        </template>
      </el-table-column>
     <!-- <el-table-column
        prop="Queue"
        label="Queue">
      </el-table-column>-->
      <el-table-column
        prop="callerId"
        label="Caller ID">
      </el-table-column>
      <el-table-column
        prop="callerContext"
        label="Caller Context">
      </el-table-column>
    </el-table>
  </section>
</template>


<script>
  import dao from '../../common/dao'
  import util from '../../common/util'
  export default {
    components: {},
    data() {
      return {
        tableData:[],
        query:{}
      }
    },
    methods: {
      pageInit(){
        let query = this.$store.state.route.query || {};
        this.query = query
        let task_id = query.user_task_detail_id;
        let body = {task_id}
        if(query.history) body ={application_id:query.task_real_id };
        body.taskType = query.taskType;
        dao.getTezByTaskID( body).then(res => {
          if (res.FX.err) return false
          this.tableData = res.body.results || []
        })


      },
      toPage318(scope){
        util.save("page318",scope.row)
        this.$router.push({
          path: `/page318`,
        });
      }
    },
    mounted: function () {
      this.pageInit()
    }
  }
</script>

<style scoped>

</style>